package demo;

public class SliverCard extends Card
{
    public SliverCard (String carid, String name,String phonenumber,double money)
    {
        super(carid,name,phonenumber,money);
    }
        @Override
        public void consume(double money)
        {
        System.out.println("您当前消费：" + money);
        System.out.println("优惠后的金额为：" + money * 0.9);
        if(getMoney()<money * 0.9)
        {
            System.out.println("余额不足！请充值！");
            return;
        }
        else
        {
            setMoney(getMoney() - money* 0.9);
            System.out.println("支付成功！您的余额为"+ getMoney());
        }
    }
}
